//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.zxydsb;

import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.HeadlessException;
import java.awt.LayoutManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

public class LoginRegisterFrame extends JFrame {
    public static void main(String[] args) {
        new LoginRegisterFrame();
    }

    public LoginRegisterFrame() throws HeadlessException {
        this.initFrame();
        this.setVisible(true);
    }

    private void initFrame() {
        this.setResizable(false);
        this.setSize(600, 400);
        this.setLocationRelativeTo((Component) null);
        this.setTitle("登录注册");
        this.setDefaultCloseOperation(3);
        JTabbedPane jtp = new JTabbedPane();
        JPanel loginPanel = new JPanel();
        this.initLoginPanel(loginPanel);
        JPanel registerPanel = new JPanel();
        this.initRegisterPanel(registerPanel);
        jtp.addTab("登录", loginPanel);
        jtp.addTab("注册", registerPanel);
        this.add(jtp);
    }



    private void initLoginPanel(JPanel loginPanel) {
        loginPanel.setLayout((LayoutManager) null);
        JLabel phoneNumberLabel = new JLabel("手机号");
        phoneNumberLabel.setSize(70, 40);
        phoneNumberLabel.setLocation(100, 40);
        phoneNumberLabel.setFont(new Font("微软雅黑", 0, 20));
        JTextField phoneNumberTextField = new JTextField();
        phoneNumberTextField.setSize(300, 40);
        phoneNumberTextField.setLocation(200, 40);
        JLabel passwordLabel = new JLabel("密 码");
        passwordLabel.setSize(70, 40);
        passwordLabel.setLocation(100, 110);
        passwordLabel.setFont(new Font("微软雅黑", 0, 20));
        JPasswordField passwordTextField = new JPasswordField();
        passwordTextField.setSize(300, 40);
        passwordTextField.setLocation(200, 110);
        JLabel verifyCodeLabel = new JLabel("验证码");
        verifyCodeLabel.setSize(70, 40);
        verifyCodeLabel.setLocation(100, 180);
        verifyCodeLabel.setFont(new Font("微软雅黑", 0, 20));
        JTextField verifyCodeTextField = new JTextField();
        verifyCodeTextField.setSize(150, 40);
        verifyCodeTextField.setLocation(200, 180);
        JLabel verifyCodeDisplayLabel = new JLabel("");
        verifyCodeDisplayLabel.setSize(100, 40);
        verifyCodeDisplayLabel.setLocation(400, 180);
        verifyCodeDisplayLabel.setFont(new Font("微软雅黑", 0, 20));
        verifyCodeDisplayLabel.setForeground(Color.RED);
        verifyCodeDisplayLabel.setCursor(new Cursor(12));
        JButton loginButton = new JButton("登录");
        loginButton.setSize(150, 40);
        loginButton.setLocation(220, 240);
        loginButton.setFont(new Font("微软雅黑", 0, 20));
        JLabel registLabel = new JLabel("注册");
        registLabel.setSize(40, 25);
        registLabel.setLocation(380, 260);
        registLabel.setFont(new Font("微软雅黑", 0, 13));
        registLabel.setForeground(Color.BLUE);
        registLabel.setCursor(new Cursor(12));
        loginPanel.add(phoneNumberLabel);
        loginPanel.add(phoneNumberTextField);
        loginPanel.add(passwordLabel);
        loginPanel.add(passwordTextField);
        loginPanel.add(verifyCodeLabel);
        loginPanel.add(verifyCodeTextField);
        loginPanel.add(verifyCodeDisplayLabel);
        loginPanel.add(loginButton);
        loginPanel.add(registLabel);
        registLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
        registLabel.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {;
            }
        });
    }


    private void initRegisterPanel(JPanel registerPanel) {
        registerPanel.setLayout((LayoutManager) null);
        JLabel phoneNumberLabel = new JLabel("手机号");
        phoneNumberLabel.setSize(70, 40);
        phoneNumberLabel.setLocation(100, 40);
        phoneNumberLabel.setFont(new Font("微软雅黑", 0, 20));
        JTextField phoneNumberTextField = new JTextField();
        phoneNumberTextField.setSize(300, 40);
        phoneNumberTextField.setLocation(200, 40);
        JLabel passwordLabel = new JLabel("密 码");
        passwordLabel.setSize(70, 40);
        passwordLabel.setLocation(100, 110);
        passwordLabel.setFont(new Font("微软雅黑", 0, 20));
        JPasswordField passwordTextField = new JPasswordField();
        passwordTextField.setSize(300, 40);
        passwordTextField.setLocation(200, 110);
        JLabel verifyCodeLabel = new JLabel("确认密码");
        verifyCodeLabel.setSize(80, 40);
        verifyCodeLabel.setLocation(100, 180);
        verifyCodeLabel.setFont(new Font("微软雅黑", 0, 20));
        JTextField verifyCodeTextField = new JTextField();
        verifyCodeTextField.setSize(300, 40);
        verifyCodeTextField.setLocation(200, 180);
        JLabel verifyCodeDisplayLabel = new JLabel("");
        verifyCodeDisplayLabel.setSize(100, 40);
        verifyCodeDisplayLabel.setLocation(400, 180);
        verifyCodeDisplayLabel.setFont(new Font("微软雅黑", 0, 20));
        verifyCodeDisplayLabel.setForeground(Color.RED);
        verifyCodeDisplayLabel.setCursor(new Cursor(12));
        JButton registerButton = new JButton("注册");
        registerButton.setSize(150, 40);
        registerButton.setLocation(220, 240);
        registerButton.setFont(new Font("微软雅黑", 0, 20));
        registerPanel.add(phoneNumberLabel);
        registerPanel.add(phoneNumberTextField);
        registerPanel.add(passwordLabel);
        registerPanel.add(passwordTextField);
        registerPanel.add(verifyCodeLabel);
        registerPanel.add(verifyCodeTextField);
        registerPanel.add(verifyCodeDisplayLabel);
        registerPanel.add(registerButton);
    }
}
